package com.sright.bcard.common.service.share.exception.base;

import com.sright.bcard.common.service.share.exception.code.BusinessCode;
import org.apache.poi.ss.formula.functions.T;

public class BusinessErrorException extends RuntimeException{
    protected Integer code;
    protected Object data;

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    protected String errorMsg;

    public BusinessErrorException(BusinessCode appHttpCodeEnum){
        super(appHttpCodeEnum.getMessage());
        this.errorMsg = appHttpCodeEnum.getMessage();
        this.code = appHttpCodeEnum.getCode() ;
    }

    public BusinessErrorException(Integer code, String errorMsg, T data){
        this.errorMsg = errorMsg;
        this.code = code ;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public Object getData() {
        return data;
    }
}
